package cn.gong.movie.ui;

import java.util.ArrayList;

import cn.gong.movie.bean.Drama;
import cn.gong.movie.data.DataDrama;
import android.os.Bundle;
import android.view.View;
import framework.annotation.ClickMethod;
import framework.base.BaseAct;

public class ActTest extends BaseAct {

	ArrayList<Drama> dramas;

	@Override
	public void onCreateAct(Bundle savedInstanceState) {
		super.onCreateAct(savedInstanceState);
		setContentView(R.layout.test);
		dramas = new ArrayList<Drama>();
		dramas.add(new Drama("欢乐合唱团S01", "20130701", 1, 22, new boolean[22], 0));
		dramas.add(new Drama("欢乐合唱团S02", "20130701", 1, 22, new boolean[22], 0));
		dramas.add(new Drama("欢乐合唱团S03", "20130701", 1, 22, new boolean[22], 0));
		dramas.add(new Drama("欢乐合唱团S04", "20130701", 1, 22, new boolean[22], 0));
		dramas.add(new Drama("童话镇S02", "20130701", 1, 22, new boolean[22], 0));
		dramas.add(new Drama("春心荡漾S01", "20130604", 1, 24, new boolean[24], 0));
		dramas.add(new Drama("衰姐们S01", "20140411", 1, 10, new boolean[10], 0));
		dramas.add(new Drama("衰姐们S02", "20140411", 1, 10, new boolean[10], 0));
		dramas.add(new Drama("港湾S01", "20130701", 1, 13, new boolean[13], 0));
		dramas.add(new Drama("港湾S02", "20130701", 1, 13, new boolean[13], 0));
		dramas.add(new Drama("港湾S03", "20130701", 1, 13, new boolean[13], 0));
		dramas.add(new Drama("港湾S04", "20130914", 1, 13, new boolean[13], 0));
		dramas.add(new Drama("亡者归来S01", "20131231", 1, 24, new boolean[24], 0));
		dramas.add(new Drama("绿箭侠S01", "20130701", 1, 23, new boolean[23], 0));
		dramas.add(new Drama("灭世S01", "20130701", 1, 20, new boolean[20], 0));
		dramas.add(new Drama("权力的游戏S01", "20130701", 1, 10, new boolean[10], 0));
		dramas.add(new Drama("权力的游戏S02", "20130701", 1, 10, new boolean[10], 0));
		dramas.add(new Drama("权力的游戏S03", "20130701", 1, 10, new boolean[10], 0));
		dramas.add(new Drama("实习医生格蕾S01", "20130701", 1, 9, new boolean[9], 0));
		dramas.add(new Drama("实习医生格蕾S02", "20130701", 1, 27, new boolean[27], 0));
		dramas.add(new Drama("实习医生格蕾S03", "20130701", 1, 25, new boolean[25], 0));
		dramas.add(new Drama("实习医生格蕾S04", "20130701", 1, 17, new boolean[17], 0));
		dramas.add(new Drama("实习医生格蕾S05", "20130701", 1, 24, new boolean[24], 0));
		dramas.add(new Drama("实习医生格蕾S06", "20130701", 1, 24, new boolean[24], 0));
		dramas.add(new Drama("实习医生格蕾S07", "20130701", 1, 22, new boolean[22], 0));
		dramas.add(new Drama("实习医生格蕾S08", "20130701", 1, 24, new boolean[24], 0));
		dramas.add(new Drama("实习医生格蕾S09", "20130701", 1, 24, new boolean[24], 0));
		dramas.add(new Drama("丑女贝蒂S01", "20130701", 1, 23, new boolean[23], 0));
		dramas.add(new Drama("丑女贝蒂S02", "20130701", 1, 18, new boolean[18], 0));
		dramas.add(new Drama("丑女贝蒂S03", "20130701", 1, 24, new boolean[24], 0));
		dramas.add(new Drama("丑女贝蒂S04", "20130701", 1, 20, new boolean[20], 0));
		dramas.add(new Drama("美女上错身S05", "20130701", 1, 13, new boolean[13], 0));
		dramas.add(new Drama("穹顶之下S01", "20130625", 1, 24, new boolean[24], 0));
		dramas.add(new Drama("龙门镖局", "20130701", 1, 40, new boolean[40], 0));
		dramas.add(new Drama("天桥风云S12", "20130701", 1, 15, new boolean[15], 0));
		dramas.add(new Drama("神盾局特工S01", "20130924", 1, 24, new boolean[24], 0));
		dramas.add(new Drama("摩登家庭S05", "20130925", 1, 24, new boolean[24], 0));
		dramas.add(new Drama("生活大爆炸S07", "20130927", 1, 24, new boolean[24], 0));
	}

	private int num = 0;

	@ClickMethod(R.id.test_bt_1)
	protected void clickWantDramaAdd6(View view) {
		DataDrama.setDrama(getContext(), dramas.get(num), getDBCallBack());
	}

	@Override
	public void onDbCallBack(int dbTaskType, Object data) {
		super.onDbCallBack(dbTaskType, data);
		num++;
		if (num < dramas.size()) {
			DataDrama.setDrama(getContext(), dramas.get(num), getDBCallBack());
		} else {
			toast("成功");
		}
	}
}
